﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Prolog.Workbench"
             x:Class="Prolog.Workbench.InstructionStreamUserControl"
             x:Name="ctrlInstructionStream"
             Height="300" Width="300">
    <UserControl.Resources>
        <Style x:Key="InstructionStreamEntryStyle" TargetType="{x:Type TextBlock}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsCurrentInstruction}" Value="true">
                    <Setter Property="FontWeight" Value="Bold"/>
                    <Setter Property="FontStyle" Value="Italic"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid>
        <DockPanel>
            <TextBox Text="Instructions"
                     DockPanel.Dock="Top" 
                     Background="{DynamicResource HeadingBrush}" FontWeight="Bold" />
            <ListBox ItemsSource="{Binding Path=InstructionStream, ElementName=ctrlInstructionStream}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" TextWrapping="Wrap" Style="{StaticResource InstructionStreamEntryStyle}" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </DockPanel>
   </Grid>
</UserControl>
